package com.atguigu.gmall.jvm;

/**
 * @author 陈昆昆
 * @version 1.0
 * @date 2020/6/5 11:27
 */
public class Anquan {

    //内部产生内部消亡 线程安全
    public static void Add(){
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(1);
        stringBuilder.append('3');
        stringBuilder.append(2.0);
        ///
    }
    //不是内部产生的 传参进来的都是不安全的
    public static void Add1(StringBuilder stringBuilder){
        stringBuilder.append(1);
        stringBuilder.append(1);
        stringBuilder.append(1);
        stringBuilder.append(1);
    }

    //不在内部消亡的
    public static StringBuilder Add2(){
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(1);
        stringBuilder.append(1);
        stringBuilder.append(1);
        stringBuilder.append(1);
        return stringBuilder;
    }

    //线程安全的
    public static String Add3(){
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(1);
        stringBuilder.append(1);
        stringBuilder.append(1);
        stringBuilder.append(1);
        return stringBuilder.toString();
    }



}
